package HuaweiOD;

import java.util.Arrays;
import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] nums = Arrays.stream(in.nextLine().split(" ")).mapToInt(num -> Integer.parseInt(num)).toArray();
        int xm = Integer.parseInt(in.nextLine());
        System.out.println(solve(nums, 0, nums.length -1 , xm) + 1);
    }
    
    public static int solve(int[] nums, int l, int r, int xm) {
        if (l >= r) return r;
        int mid = l + ((r - l) >> 1);
        if (nums[mid] < xm) return solve(nums, mid + 1, r, xm);
        return solve(nums, l, mid - 1, xm);
    }
}
